package dsq.lesson.cookie.util;

import java.util.HashMap;
import java.util.Map;

import dsq.lesson.cookie.entity.Book;

public class DBUtil {

	private static Map<String, Book> books = new HashMap<>();
	
	
	static {
		books.put("1", new Book("1", "天龙八部", 20, "金金"));
		books.put("2", new Book("2", "射雕英雄传", 30, "金金"));
		books.put("3", new Book("3", "九尾天狐", 40, "金金"));
		books.put("4", new Book("4", "鹿鼎记", 50, "金金"));
	}
	
	
	public static Map<String, Book> findAllBooks(){
		return books;
	}
	
	public static Book findBookById(String id) {
		return books.get(id);
	}
	
}
